import { setGlobal } from '@swda/utils'
//-----------------------------------------------------------------------------
// Window_Instruction
//
// The window for displaying the instruction of current Scene.

function Window_Instruction() {
    this.initialize.apply(this, arguments);
}

Window_Instruction.prototype = Object.create(Window_Base.prototype);
Window_Instruction.prototype.constructor = Window_Instruction;

Window_Instruction.prototype.initialize = function(x,y,width,height) {
    //var width = Graphics.boxWidth;
    //var height = this.fittingHeight(numLines || 2);
    Window_Base.prototype.initialize.call(this, x, y, width, height);
    this._text = '';
    this.opacity = 0;
    this.setBackgroundType(2)//dimmer type
    this.setNormalColor(this.textColor(0));
};

Window_Instruction.prototype.setText = function(text) {
    if (this._text !== text) {
        this._text = text;
        this.refresh();
    }
};

Window_Instruction.prototype.clear = function() {
    this.setText('');
};

Window_Instruction.prototype.refresh = function() {
    this.contents.clear();
    this.changeTextColor(this.systemColor())
    this.drawTextEx(this._text, this.textPadding(), 0);
};

setGlobal('Window_Instruction', Window_Instruction);
//window.Window_Instruction = Window_Instruction;